package socket;

import java.util.Arrays;

/**
 * 测试从数组中删除指定元素的逻辑
 *
 * @author Luka
 * @date 2021/06/05 11:35
 **/
public class Test {
    public static void main(String[] args) {
        int[] allout = {1,4,5,8,34,78,123,8784,34567};
        int pw = 123;
        System.out.println(Arrays.toString(allout));
        for (int i = 0; i <allout.length ; i++) {
            if (allout[i]==pw){
                allout[i] = allout[allout.length-1];
                allout = Arrays.copyOf(allout,allout.length-1);
                break;
            }
        }

        System.out.println(Arrays.toString(allout));
    }
}